Ext.define('carManage.view.repairInfo.EditOrAddForm', {
    extend: 'Ext.form.Panel',
    alias: 'widget.editOrAddForm',
    labelWidth: 60,
    width: '100%',
    height: '100%',
    bodyStyle: 'padding: 4px',
    border: false,
    autoscroll: true,
    frame: true,
    autoScroll: true,
    items: [{
            xtype: 'container',
            anchor: '100%',
            layout: 'hbox',
            items: [{
                    xtype: 'container',
                    flex: 1,
                    layout: 'anchor',
                    items: [
                        {
                            xtype: 'hidden',
                            name: 'id'
                        }, {
                            xtype: 'combo',
                            fieldLabel: '车牌号码',
                            queryParam: 'name',
                            autoSelect: false,
                            name: 'car_code',
                            displayField: 'name',
                            valueField: 'name',
                            emptyText: '车牌号码',
                            anchor: '95%',
                            typeAhead: true,
                            triggerAction: 'all',
                            store: 'CarList_store'
                        }, {
                            xtype: 'combo',
                            fieldLabel: '驾驶员',
                            name: 'driver',
                            displayField: 'name',
                            valueField: 'name',
                            emptyText: '驾驶员',
                            anchor: '95%',
                            typeAhead: true,
                            triggerAction: 'all',
                            queryParam: 'name',
                            minChars: 2,
                            store: 'DriverComboStore'
                        }, {
                            xtype: 'datefield',
                            fieldLabel: '维修日期',
                            emptyText: '维修日期（必填）',
                            allowBlank: false,
                            name: 'repair_date',
                            altFormats: 'Ymd|Y-m-d',
                            format: 'Y-m-d',
                            dateFormat: 'Y-m-d',
                            anchor: '95%'
                        }, {
                            xtype: 'textfield',
                            fieldLabel: '修理厂',
                            allowBlank: false,
                            displayField: 'name',
                            emptyText: '修理厂（必填）',
                            anchor: "95%",
                            name: 'area'
                        }, {
                            xtype: 'numberfield',
                            fieldLabel: '维修金额',
                            emptyText: '维修金额（必填）',
                            allowBlank: false,
                            name: 'repair_price',
                            anchor: '95%'
                        }
                    ]
                }, {
                    xtype: 'container',
                    flex: 1,
                    layout: 'anchor',
                    items: [
                        {
                            xtype: 'numberfield',
                            fieldLabel: '维修前里程',
                            emptyText: '维修前里程（必填）',
                            allowBlank: false,
                            name: 'mileage',
                            anchor: '95%'
                        }, {
                            xtype: 'datefield',
                            fieldLabel: '批准日期',
                            emptyText: '批准日期',
                            name: 'approve_date',
                            altFormats: 'Ymd|Y-m-d',
                            format: 'Y-m-d',
                            dateFormat: 'Y-m-d',
                            anchor: '95%'
                        }, {
                            xtype: 'textfield',
                            fieldLabel: '维修批准人',
                            emptyText: '维修批准人',
                            name: 'approve_person',
                            anchor: '95%'
                        }, {
                            xtype: 'combo',
                            fieldLabel: '维修方式',
                            hiddenName: 'type',
                            store: 'RepairTypeStore',
                            displayField: 'name',
                            valueField: 'value',
                            typeAhead: true,
                            triggerAction: 'all',
                            emptyText: '---请选择---',
                            anchor: "95%",
                            name: 'type',
                            selectOnFocus: true
                        }, {
                            xtype: 'radiogroup',
                            fieldLabel: '里程表清零',
                            name: 'clean',
                            anchor: '95%',
                            items: [{
                                    boxLabel: '是',
                                    name: 'clean',
                                    inputValue: 'yes'
                                }, {
                                    boxLabel: '否',
                                    name: 'clean',
                                    inputValue: 'no'
                                }]
                        }
                    ]
                }]
        }, {
            xtype: 'htmleditor',
            name: 'repair_content',
            fieldLabel: '维修内容',
            anchor: '98%'
        }, {
            xtype: 'textarea',
            name: 'remark',
            fieldLabel: '备注',
            height: 50,
            anchor: '98%'
        }],
    initComponent: function() {
        this.callParent(arguments);
    }
});